/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "log_sistema_detalhe", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "LogSistemaDetalhe.findAll", query = "SELECT l FROM LogSistemaDetalhe l")})
public class LogSistemaDetalhe implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "log_sistema_detalhe_id_log_sistema_seq")
    @SequenceGenerator(name = "log_sistema_detalhe_id_log_sistema_seq", sequenceName = "log_sistema_detalhe_id_log_sistema_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @Column(name = "id_log_sistema", nullable = false)
    private Integer idLogSistema;
    @Size(max = 500)
    @Column(name = "dsc_usuario", length = 500)
    private String dscUsuario;
    @Size(max = 500)
    @Column(name = "dsc_sistema", length = 10000)
    private String dscSistema;
    //@JoinColumn(name = "id_log", referencedColumnName = "id_log")
    //@ManyToOne
    @JoinColumn(name = "id_log", referencedColumnName = "id_log", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private LogSistema idLog;

    public LogSistemaDetalhe() {
    }

    public LogSistemaDetalhe(Integer idLogSistema) {
        this.idLogSistema = idLogSistema;
    }

    public Integer getIdLogSistema() {
        return idLogSistema;
    }

    public void setIdLogSistema(Integer idLogSistema) {
        this.idLogSistema = idLogSistema;
    }

    public String getDscUsuario() {
        return dscUsuario;
    }

    public void setDscUsuario(String dscUsuario) {
        this.dscUsuario = dscUsuario;
    }

    public String getDscSistema() {
        return dscSistema;
    }

    public void setDscSistema(String dscSistema) {
        this.dscSistema = dscSistema;
    }

    public LogSistema getIdLog() {
        return idLog;
    }

    public void setIdLog(LogSistema idLog) {
        this.idLog = idLog;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLogSistema != null ? idLogSistema.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LogSistemaDetalhe)) {
            return false;
        }
        LogSistemaDetalhe other = (LogSistemaDetalhe) object;
        if ((this.idLogSistema == null && other.idLogSistema != null) || (this.idLogSistema != null && !this.idLogSistema.equals(other.idLogSistema))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.LogSistemaDetalhe[ idLogSistema=" + idLogSistema + " ]";
    }
    
}
